﻿using BW.MesProject.Production.Domain.Dto.Output.ProductionReport;
using BW.MesProject.Production.Infrastructure;
using BW.MesProject.Public.ErrorCode;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace BW.MesProject.Production.Host.Controllers
{
    /// <summary>
    /// 产出控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ProductionReportController : ControllerBase
    {
        private readonly IProductionReportServices _productionReportServices;

        public ProductionReportController(IProductionReportServices productionReportServices)
        {
            _productionReportServices = productionReportServices;
        }
        /// <summary>
        /// 获取工单对应工序的产出记录
        /// </summary>
        /// <param name="PMId"></param>
        /// <param name="WorkOrderCode"></param>
        /// <returns></returns>
        [HttpGet]
        public ApiResult<List<ProductionReportOutput>> GetOutPut(string PMId, string WorkOrderCode)
        {
            return _productionReportServices.GetOutPut(PMId, WorkOrderCode);
        }
    }
}
